Download
FAQ
History
HomeHomeNext API
Search
Feedback
Divider

The Example JSP Pages

This chapter illustrates JSP scripting elements using a version of the hello2 example introduced in Chapter 3--webclient--that accesses a Web service. To build, package, deploy, and run the webclient example:

  1. Build and deploy the JAX-RPC Web service MyHelloService described in Creating a Web Service with JAX-RPC.
  2. In a terminal window, go to <INSTALL>/j2eetutorial14/examples/jaxrpc/webclient/.
  3. Run asant build. This target copies the JSP pages to the <INSTALL>/j2eetutorial14/examples/jaxrpc/webclient/build/ directory and runs wscompile to generate the JAX-RPC client stubs.
  4. Start deploytool.
  5. Create a Web application called webclient by running the New Web Application Wizard. Select FileRight ArrowNewRight ArrowWeb Application WAR.
  6. New Web Application Wizard
    1. Select the Create New Stand-Alone WAR Module radio button.
    2. Click Browse and in the file chooser, navigate to <INSTALL>/j2eetutorial14/examples/jaxrpc/webclient/.
    3. In the File Name field, enter webclient.
    4. Click Choose Module File.
    5. In the WAR Display Name field enter webclient.
    6. In the Context Root field, enter /webclient.
    7. Click Edit to add the content files.
    8. In the Edit Contents dialog, navigate to <INSTALL>/j2eetutorial14/examples/jaxrpc/webclient/build/. Select duke.waving.gif, greeting.jsp, response.jsp, and the webclient directory and click Add.
    9. Click OK.
    10. Click Next.
    11. Select the JSP radio button.
    12. Click Next.
    13. Select greeting.jsp from the Servlet Class combo box.
    14. Click Finish.
  7. Add an alias to the greeting Web component.
    1. Select the greeting Web component.
    2. Select the Aliases tab.
    3. Click Add to add a new mapping.
    4. Type /greeting in the aliases list.
  8. Select FileRight ArrowSave.
  9. Deploy the WAR.
  10. Open your browser to http://localhost:1024/webclient/greeting
Divider
Download
FAQ
History
HomeHomeNext API
Search
Feedback
Divider

All of the material in The J2EE 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.